package com.example.serviceribbon.controller;

import com.example.serviceribbon.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.GET;

@RestController
public class HelloController {
    @Value("${server.port}")//服务端口号
    String port;
    @Autowired
    HelloService helloService;
    @GetMapping("/hello")
    public String getHello(){
        return helloService.getHello()+" ribbon:"+port;
    }
}
